import * as types from './mutation-type'

export default {
  addItemNum({commit, state}, payload) {
    // 点击下一题，记录答案id，判断是否是最后一题，如果不是则跳转下一题
    commit(types.SAVE_ANSWER, payload);
    if (state.itemNum < state.itemDetail.length) {
      commit(types.ADD_ITEMNUM);
    }
  },
  initializeData({commit}){
    commit(types.INITIALIZE_DATA)
  }
}

